<%@ page import="vy.org.app.common.*" %>
<%@ page import="org.vy.dal.dao.*" %>
<%@ page import="java.util.*" %>
<%@ page import="net.sf.json.JSON" %>
<%@ page import="net.sf.json.JSONSerializer" %>
<%@ page import="java.util.Map.Entry" %>
<%@ page import="vy.org.app.page.subscription.magazine.MagazineForm"%>
<%@ page import="vy.org.app.page.subscription.dabba.DabbaForm"%>
<%@ page import="vy.org.app.page.address.AddressForm"%>
<%@ page import="vy.org.app.page.lookup.patrika.MntnPatrikaForm"%>
<%@ page import="vy.org.app.page.lookup.delivery.MntnDeliveryModeForm"%>
<%@ page import="vy.org.app.page.lookup.patrika.MntnPatrikaPeriodForm" %>
<%@ page import="org.vy.dal.dao.lookup.ViewVyLookupCitiesDO" %>
<%@ page import="net.sf.json.JSONSerializer"%>
<%@ taglib uri="/WEB-INF/lib/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/lib/struts-bean.tld" prefix="bean"%>
<%@ page buffer="500kb" autoFlush="true" %>
<%!
	private static final String EMPTY = "";
	private UserCtx m_user;
	private static final String[] MONTHS = {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
%>
<%
	ResourceBundle RESOURCE = ResourceBundle.getBundle("LabelResource",ActionCtx.ctx().getLocale());

	m_user = ActionCtx.ctx(request).getUser();
  	List<ViewVyMemberDO> results = (List<ViewVyMemberDO>)request.getAttribute(AppConstants.RESULT);
  	boolean canAdd = m_user.hasAccessToModule(ModuleEnum.ADD_MEMBER.getId().toString());
  	boolean canDelete = m_user.hasAccessToModule(ModuleEnum.DELETE_MEMBER.getId().toString());
  	boolean canEdit = m_user.hasAccessToModule(ModuleEnum.EDIT_MEMBER.getId().toString());
  	Calendar cal = Calendar.getInstance();
  	int year = cal.get(Calendar.YEAR);
%>
<bean:define id="memberForm" name="memberForm" scope="request" type="vy.org.app.page.member.MemberForm"/>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> 
	<link rel="stylesheet" type="text/css" href="./css/Common.css">
	<link rel="stylesheet" type="text/css" href="./scripts/datepicker/jsDatePick_ltr.css">
	<script type="text/javascript" src="./scripts/Common.js"></script>
	<script type="text/javascript" src="./scripts/validateForm.js"></script>
	<script type="text/javascript" src="./scripts/KrutidevUnicode.js"></script>
	<script type="text/javascript" src="./scripts/datepicker/jsDatePick.full.1.3.js"></script>
	<style>
		table td.lbl {text-align:right;}
		table table {width:980px;border-color:white;}
		table table td {border-color:white;padding-left:5px;padding-right:5px;}
		textarea {margin-left: 5px;}
		.mnd {background-color:yellow;}
	</style>
	<script type="text/JavaScript" language="javascript">
	function validateForm(){
		var flag = true;
		var val = document.getElementById('presentAddress.coName').value;
		if(!checkChar('firstName',"FirstName"))
			flag=false;
		else if(!checkChar('lastName',"LastName"))
			flag=false;
		else if(!checkChar('middleName',"MiddleName"))
			flag=false;
		else if(!checkAlphanumeric('panNo',"PAN No"))
			flag=false;
		else if(!checkEmail('email',"Email"))
			flag=false;
		else if(!checkInt('phoneNumber',"Contact"))
			flag=false;
		else if(!checkChar('updeshta',"Updesh by"))
			flag=false;
		else if(!checkChar('placeOfUpdesh',"Place Of Updesh"))
			flag=false;
		else if(!val.match(regChar)&& val !=''){
			alert(val+" should be Alphabetic !");
			flag=false;
		}
		else if(!checkChar('presentAddress.districtOrCounty',"District"))
			flag=false;
				
		
		return flag;
		}
	
	function toggleOnOff(id){
		var elm = document.getElementById(id);
		if(!elm) return;
		 
		if(elm.style.display == "none"){
			elm.style.display = "";
		}else {
			elm.style.display = "none";
		}
	}
	
	function addRow(tableID) {

		var table = document.getElementById(tableID);
		var rowCount = table.rows.length;
		var row = table.insertRow(rowCount);
		var colCount = table.rows[0].cells.length;
		for(var i=0; i<colCount; i++) {
			var newcell	= row.insertCell(i);
			newcell.innerHTML = table.rows[0].cells[i].innerHTML;
			//alert(newcell.childNodes);
			switch(newcell.childNodes[0].type) {
				case "text":
						newcell.childNodes[0].value = "";
						break;
				case "checkbox":
						newcell.childNodes[0].checked = false;
						break;
				case "select-one":
						newcell.childNodes[0].selectedIndex = 0;
						break;
			}
		}
	}
	
	function deleteRow(tableID) {
		try {
			var table = document.getElementById(tableID);
			var rowCount = table.rows.length;
			for(var i=0; i<rowCount; i++) {
				var row = table.rows[i];
				var chkbox = row.cells[0].childNodes[0];
				if(null != chkbox && true == chkbox.checked) {
					if(rowCount <= 1) {
						alert("Cannot delete all the rows.");
						break;
					}
	
					table.deleteRow(i);
					rowCount--;
					i--;
				}
			}
		}catch(e) {
			alert(e);
		}
	}

	</script>

</head> 
<body>
<form name="memberForm" method=post Action="./savemember.do" onsubmit="return validateForm();">

<input type="hidden" name="mode" id="mode" value="SAVE">
<input type="hidden" name="lang" id="lang" value="<%=ActionCtx.ctx().getLang() %>">
<input type="hidden" name="vyId" id="vyId" value="<%=memberForm.getVyId() %>" />
<input type="hidden" name="magazineSubscriptionCnt" id="magazineSubscriptionCnt" value="<%=memberForm.getMagazineSubscriptionCnt() %>" />
<input type="hidden" name="dabbaSubscriptionCnt" id="dabbaSubscriptionCnt" value="<%=memberForm.getDabbaSubscriptionCnt() %>" />

<table class="qry" border="0" cellpadding="0" cellspacing="0" width="850px">
	<tr>
        <td><img src="./pages/image_gif/mf.gif" width="100%" height="35"></td>
    </tr> 
    <tr>
      <td style="text-align:right;width:850px;">
      <!-- <a id="kruti" class="alang" href="javascript:;"><%=RESOURCE.getString(AppConstants.Languages.KRUTI) %></a>
      	<a id="hindi" class="alang" href="javascript:;"><%=RESOURCE.getString(AppConstants.Languages.HINDI) %></a>
      	<a id="english" class="alang" href="javascript:;"><%=RESOURCE.getString(AppConstants.Languages.ENGLISH) %></a>
      	-->
      </td>
    </tr>
  <tr>
  	<td><a href="javascript:;" onclick="toggleOnOff('togrow0');"><img src="./pages/image_gif/pi.gif" alt="" name="personel_info" width="100%" height="22" border="0"></a></td>
  </tr>
  <tr id="togrow0">
  	<td>
	   <table border="1" cellpadding="0" cellspacing="0" width="100%">
          <tr bgcolor="#EBEBEB">
            <td width="20%"><%=RESOURCE.getString("FIRST_NAME") %></td>
            <td width="30%"><input name="firstName" type="text" class="textBoxDashed mnd" id="firstName" size="33" maxlength="100" value="<bean:write name='memberForm' property='firstName' />"></td>
            <td width="20%"><%=RESOURCE.getString("LAST_NAME") %></td>
            <td width="30%"><input name="lastName" type="text" class="textBoxDashed mnd" id="lastName" size="33" maxlength="100" value="<bean:write name='memberForm' property='lastName' />"></td>
          </tr>
          <tr bgcolor="#EBEBEB">
            <td><%=RESOURCE.getString("MIDDLE_NAME") %></td>
            <td colspan="3"><input name="middleName" type="text" class="textBoxDashed" id="middleName" size="33" maxlength="100" value="<bean:write name='memberForm' property='middleName' />"></td>
          </tr>
          <tr bgcolor="#EBEBEB">
            <td><%=RESOURCE.getString("REGIONAL_LANG_NAME") %></td>
            <td><input name="regionalLangName" type="text" class="textBoxDashed" id="regionalLangName" size="33" maxlength="200" value="<bean:write name='memberForm' property='regionalLangName' />"></td>
            <td><%=RESOURCE.getString("UPDESTHA") %></td>
            <td>
            	<input name="isUpdestha" type="radio" id="isUpdestha" <%=(memberForm.getIsUpdestha()!=null && memberForm.getIsUpdestha() == true? "checked" :"" ) %> value="true">&nbsp;<%=RESOURCE.getString("YES")%>
            	<input name="isUpdestha" type="radio" id="isUpdestha" <%=(memberForm.getIsUpdestha()!=null && memberForm.getIsUpdestha() == false? "checked" :"" )%> value="false">&nbsp;<%=RESOURCE.getString("NO") %>
            </td>
          </tr>
          <tr bgcolor="#EBEBEB">
			<TD><%=RESOURCE.getString("SEX") %></TD> 
			<TD>&nbsp;
			  <INPUT name="sex" id="male" type="radio" <%=("M".equals(memberForm.getSex())? "checked" :"" ) %>  class="textBoxDashed mnd" value="M">              
			  <%=RESOURCE.getString("MALE") %>&nbsp;&nbsp;&nbsp;&nbsp;
			  <INPUT name="sex" id="female" type="radio" <%=("F".equals(memberForm.getSex())? "checked" :"" ) %> class="textBoxDashed mnd" value="F">
			  <%=RESOURCE.getString("FEMALE") %>&nbsp;
			</TD>
            <td><%=RESOURCE.getString("DATE_OF_BIRTH") %></td>
            <td>
			  <SELECT style="width: 50px;" name="dobDay" class="mnd">
				<OPTION value="">DD</OPTION>
				<%
				for(int i1=1;i1<=31;i1++){
					if(String.valueOf(i1).equals(memberForm.getDobDay()))
						out.println("<option selected=\"selected\" value="+i1+">"+i1+"</option>");
					else
						out.println("<option value="+i1+">"+i1+"</option>");
				}
				%>
			  </SELECT> 
			  <SELECT style="width: 50px;" name="dobMonth"  class="mnd">
				<OPTION value="">MM</OPTION>
				<%
				for(int i1=1;i1<=12;i1++){
					if(String.valueOf(i1).equals(memberForm.getDobMonth()))
						out.println("<option selected=\"selected\" value="+i1+">"+MONTHS[i1-1]+"</option>");
					else
						out.println("<option value="+i1+">"+MONTHS[i1-1]+"</option>");
				}
				%>
			  </SELECT>
			  <SELECT style="width: 100px;" name="dobYear" class="mnd">
				<OPTION value="">YYYY</OPTION>
				<%
				for(int i1=year; i1>1900; i1--){
					if(String.valueOf(i1).equals(memberForm.getDobYear()))
						out.println("<option selected=\"selected\" value="+i1+">"+i1+"</option>");
					else
						out.println("<option value="+i1+">"+i1+"</option>");
				}
				%>
			  </SELECT>
            </td>
          </tr>
		  <TR bgcolor="#EBEBEB"> 
			<TD><%=RESOURCE.getString("NATIONALITY") %></TD> 
			<TD> 
			  <SELECT name="nationality" id="nationality">
				<option value="" >Select</option>
			  	<%
		  		if(memberForm.getOfficeAddress().getCountries() != null){
			  		for(ViewVyLookupCitiesDO prcountry: memberForm.getOfficeAddress().getCountries()){
			  			if(prcountry.getCountryCode().equals(memberForm.getNationality()))
			  				out.println("<option selected=\"selected\" value=\""+ prcountry.getCountryCode() +"\">"+ prcountry.getCountryName() +"</option>");
			  			else
			  				out.println("<option value=\""+ prcountry.getCountryCode() +"\">"+ prcountry.getCountryName() +"</option>");
			  		}
		  		}
			  	%>
			  </SELECT>
			</TD>
		    <TD><%=RESOURCE.getString("QUALIFICATION") %></TD> 
			<TD> 
				<SELECT id="qualification" name="qualification" >
					<OPTION value="">Select</OPTION>
				</SELECT>
			</TD> 
		  </TR> 
		  <TR bgcolor="#EBEBEB"> 
			<TD><%=RESOURCE.getString("PROFESSION") %></TD> 
			<TD>
			  <SELECT name="profession" id="profession">
				<OPTION value="">Select</OPTION>
			  </SELECT>
			</TD>
		    <TD><%=RESOURCE.getString("INTERESTS") %></TD> 
		    <TD> 
		    	<INPUT name="hobbies" type="text" class="textBoxDashed" value="<%=memberForm.getHobbies()!= null? memberForm.getHobbies() : EMPTY %>" id="hobbies" size="33" maxlength="150"> 
		    </TD>
		  </TR>
		  <TR bgcolor="#EBEBEB"> 
			<TD><%=RESOURCE.getString("MARITAL_STATUS") %></TD> 
			<TD>&nbsp;
			  <INPUT name="maritalStatus" type="radio" value="S" class="mnd" <%=("S".equals(memberForm.getMaritalStatus())? "checked" : "") %>>              
			  <%=RESOURCE.getString("SINGLE") %>
			  &nbsp;&nbsp;
			  <INPUT name="maritalStatus" type="radio" value="M" class="mnd" <%=("M".equals(memberForm.getMaritalStatus())? "checked" : "") %>>
			  <%=RESOURCE.getString("MARRIED") %>&nbsp;
			</TD>
			<TD><%=RESOURCE.getString("PAN_NUMBER") %></TD> 
			<TD> 
			  <INPUT name="panNo" type="text" class="textBoxDashed" id="panNo" value="<%=memberForm.getPanNo()!= null? memberForm.getPanNo() : EMPTY %>" size="33" maxlength="50"> 
			</TD>
		  </TR>
		  <TR bgcolor="#EBEBEB"> 
			<TD><%=RESOURCE.getString("RELIGION") %></TD> 
			<TD> 
			  <SELECT name="religion" id="religion">
				<OPTION value="0" selected>Select</OPTION>
			  </SELECT>
			</TD>
			<td></td>
			<td></td>
		  </tr>
		  <tr bgcolor="#EBEBEB">			
			<TD><%=RESOURCE.getString("IDENTITY_TYPE") %></TD> 
			<TD> 
			  <select name="identityType" class="textBoxDashed" id="identityType">
			  	<option value="">Select</option>
			  	<option <%=("DL".equals(memberForm.getIdentityType())?"selected='selected'" : "") %> value="DL">Driving License</option>
			  	<option <%=("VID".equals(memberForm.getIdentityType())?"selected='selected'" : "") %> value="VID">Voter ID Card</option>
			  	<option <%=("SSN".equals(memberForm.getIdentityType())?"selected='selected'" : "") %> value="SSN">SSN (last 4 digit)</option>
			  	<option <%=("OTH".equals(memberForm.getIdentityType())?"selected='selected'" : "") %> value="OTH">Others</option>
			  </select> 
			</TD>
			<TD><%=RESOURCE.getString("IDENTITY") %></TD> 
			<TD> 
			  <INPUT name="identity" type="text" class="textBoxDashed" id="identity" value="<%=memberForm.getIdentity()!= null? memberForm.getIdentity() : EMPTY %>" size="33" maxlength="50"> 
			</TD>
		  </TR>
		  <TR bgcolor="#EBEBEB"> 
		    <td><%=RESOURCE.getString("EMAIL") %></td>
            <td><input name="email" type="text" class="textBoxDashed" id="email" size="33" maxlength="200" value="<%=memberForm.getEmail()!= null? memberForm.getEmail() : EMPTY %>"></td>
			<TD><%=RESOURCE.getString("CONTACT") %></TD> 
			<TD> 
				<input name="phoneNumber" class="mnd" type="text" id="phoneNumber" value="<%=memberForm.getPhoneNumber()!= null? memberForm.getPhoneNumber() : EMPTY %>" size="33" maxlength="20">
			</TD> 
		  </TR>
		 <TR>
	   </table> 
	</td>
	</tr>	 
	<tr>	  
	  <td><a href="javascript:;" onclick="toggleOnOff('togrow1');"><img src="./pages/image_gif/ud.gif" alt="" name="updeshtha_detail" width="100%" height="22" border="0"></a></td>
	</TR>
	<tr  id="togrow1" style="display:block">
		<td>
		  <table border="1" cellpadding="0" cellspacing="0" width="100%"> 
			<TR bgcolor="#EBEBEB"> 
				<TD width="20%"><%=RESOURCE.getString("UPDESH") %></TD> 
				<TD width="30%">&nbsp;
					  <INPUT name="updesh" type="radio" <%=("true".equalsIgnoreCase(memberForm.getUpdesh())?"checked" : "") %> id="updYes" value="true">              
					  <%=RESOURCE.getString("YES") %>
					  &nbsp;&nbsp;
					  <INPUT name="updesh" type="radio" <%=("false".equalsIgnoreCase(memberForm.getUpdesh())?"checked" : "") %> id="updNo" value="false">
					  <%=RESOURCE.getString("NO") %>&nbsp;            
				</TD> 
				  <TD width="20%"><%=RESOURCE.getString("UPDESHTA_NAME")%></TD> 
				<TD width="30%">
				  <INPUT name="updeshta" type="text" class="textBoxDashed" id="updeshta" size="33" value="<%=memberForm.getUpdeshta()!= null? memberForm.getUpdeshta() : EMPTY%>"> 
				  <!--img src="./pages/image_gif/find.png" width="16" height="16"-->
				</TD>  
		    </TR>
			<TR bgcolor="#EBEBEB"> 
				<TD><%=RESOURCE.getString("VY_EVENT")%></TD> 
				<TD> 
				  <INPUT name="updeshOnEvent" type="text" class="textBoxDashed" id="updeshOnEvent" size="33" value="<%=memberForm.getUpdeshOnEvent()!= null? memberForm.getUpdeshOnEvent() : EMPTY%>" maxlength="50"> 
				</TD> 
				  <TD><%=RESOURCE.getString("DATE_OF_UPDESH")%></TD> 
				<TD> 
				  <SELECT style="width: 50px;" name="updeshDay" size="1">
					<OPTION value="">DD</OPTION>
					<%
					for(int i1=1;i1<=31;i1++){
						if(String.valueOf(i1).equals(memberForm.getUpdeshDay()))
							out.println("<option selected=\"selected\" value="+i1+">"+i1+"</option>");
						else
							out.println("<option value="+i1+">"+i1+"</option>");
					}
					%>
				  </SELECT> 
				  <SELECT style="width: 50px;" name="updeshMonth" size="1">
					<OPTION value="">MM</OPTION>
					<%
					for(int i1=1;i1<=12;i1++){
						if(String.valueOf(i1).equals(memberForm.getUpdeshMonth()))
							out.println("<option selected=\"selected\" value="+i1+">"+MONTHS[i1-1]+"</option>");
						else
							out.println("<option value="+i1+">"+MONTHS[i1-1]+"</option>");
					}
					%>
				  </SELECT>
				  <SELECT style="width: 100px;" name="updeshYear" size="1">
					<OPTION value="">YYYY</OPTION>
					<%
					for(int i1=year; i1>1900; i1--){
						if(String.valueOf(i1).equals(memberForm.getUpdeshYear()))
							out.println("<option selected=\"selected\" value="+i1+">"+i1+"</option>");
						else
							out.println("<option value="+i1+">"+i1+"</option>");
					}
					%>
				  </SELECT>
			   </TD>
			 </TR>
			 <TR bgcolor="#EBEBEB"> 
					<TD><%=RESOURCE.getString("PLACE_OF_UPDESH")%></TD> 
					<TD>
					  <input name="placeOfUpdesh" id="placeOfUpdesh" type="text" class="drop1" value="<%=memberForm.getPlaceOfUpdesh() != null? memberForm.getPlaceOfUpdesh() : EMPTY %>" size = "33">
					</TD>
					<TD>&nbsp;</TD> 
					<TD>&nbsp;</TD>
			 </TR>
			</table>
		  </td>
		</tr>	 
		<tr>
      	 	<td><a href="javascript:;" onClick="toggleOnOff('togrow2')"><img src="./pages/image_gif/ai.gif" alt="" name="address_info" width="100%" height="22" border="0"></a></td>
  		</tr>
        <TR id="togrow2" style="display:block"> 
            <TD>
              <div>
            	<table border="0" cellpadding="0" cellspacing="0" width="100%">
            	  <tr>
      				<td><a href="javascript:;" onClick="toggleOnOff('togrow21');"><img src="./pages/image_gif/pre.gif" alt="" name="prt_add" width="100%" height="22" border="0"></a></td>
				  </tr>
				  <TR bgcolor="#EBEBEB" id="togrow21" style="<%=(memberForm.getPresentAddress().getCountry()!=null&&!"".equals(memberForm.getPresentAddress().getCountry())? "display:block":"display:none") %>">
				  	<td>
				  	  <table border="1" cellpadding="0" cellspacing="0" width="100%">
				  	    <tr> 
						  <TD width="20%">
							  <INPUT name="presentAddress.addressId" type="hidden" id="presentAddress.addressId" value="<%=memberForm.getPresentAddress().getAddressId() %>">
							  <input type="hidden" name="presentAddress.addressType" id="presentAddress.addressType" value="<%=AddressTypeEnum.PRESENT.getName() %>" />
							  <SELECT style="width: 70px;" name="presentAddress.namePrefix" id="presentAddress.namePrefix">
							  	<OPTION value="">Select</OPTION>
								<OPTION <%=("S/O".equals(memberForm.getPresentAddress().getNamePrefix())?"selected='selected'" : "") %> value="S/O">S/O</OPTION>
								<OPTION <%=("H/O".equals(memberForm.getPresentAddress().getNamePrefix())?"selected='selected'" : "") %> value="H/O">H/O</OPTION>
								<OPTION <%=("C/O".equals(memberForm.getPresentAddress().getNamePrefix())?"selected='selected'" : "") %> value="C/O">C/O</OPTION>
								<OPTION <%=("W/O".equals(memberForm.getPresentAddress().getNamePrefix())?"selected='selected'" : "") %> value="W/O">W/O</OPTION>
							  </SELECT>
							</TD> 
							<TD width="30%"> 
							  <INPUT name="presentAddress.coName" type="text" class="<%=("hi".equals(memberForm.getPresentAddress().getPrintLanguage()))? "kd010":"" %>" id="presentAddress.coName" value="<%=memberForm.getPresentAddress().getCoName() %>" size="33" maxlength="150"> 
							  </TD>
							<TD width="20%"><%=RESOURCE.getString("PRINT_LANGUAGE")%></TD> 
							<TD width="30%"> 
							  <SELECT class="mnd" name="presentAddress.printLanguage" id="presentAddress.printLanguage" onchange="changePrintLanguage('presentAddress')">
							  	<OPTION value="en" <%= ("en".equals(memberForm.getPresentAddress().getPrintLanguage()))? "selected=\"selected\"":"" %> >English</OPTION>
							  	<OPTION value="hi" <%= ("hi".equals(memberForm.getPresentAddress().getPrintLanguage()))? "selected=\"selected\"":"" %> >Hindi</OPTION>
							  </SELECT> 
							</TD>
						  </TR> 
						  <TR bgcolor="#EBEBEB"> 
							<TD><%=RESOURCE.getString("STREET")%>&nbsp; 1</TD> 
							<TD> 
							  <INPUT name="presentAddress.street1" type="text" class="textBoxDashed mnd" value="<%=memberForm.getPresentAddress().getStreet1() != null? memberForm.getPresentAddress().getStreet1() : EMPTY %>" id="presentAddress.street1" size="33" maxlength="255"> 
							</TD>
							<TD><%=RESOURCE.getString("STREET")%>&nbsp; 2</TD> 
							<TD>
							  <INPUT name="presentAddress.street2" type="text" class="textBoxDashed" value="<%=memberForm.getPresentAddress().getStreet2() != null? memberForm.getPresentAddress().getStreet2() : EMPTY%>" id="presentAddress.street2" size="33" maxlength="255"> 
							</TD>
						  </TR>
						  <TR bgcolor="#EBEBEB" id="presentAddress.lang" style="<%=("hi".equals(memberForm.getPresentAddress().getPrintLanguage()))? "display:table-row":"display:none" %>"> 
							<TD><%=RESOURCE.getString("STREET_HINDI")%>&nbsp; 1</TD> 
							<TD> 
							  <INPUT name="presentAddress.streetHindi1" type="text" class="kd010 mnd" value="<%=memberForm.getPresentAddress().getStreetHindi1() %>" id="presentAddress.streetHindi1" size="33" maxlength="255"> 
							</TD>
							<TD><%=RESOURCE.getString("STREET_HINDI")%>&nbsp; 2</TD> 
							<TD>
							  <INPUT name="presentAddress.streetHindi2" type="text" class="kd010" value="<%=memberForm.getPresentAddress().getStreetHindi2() %>" id="presentAddress.streetHindi2" size="33" maxlength="255"> 
							</TD>
						  </TR>
						  <TR bgcolor="#EBEBEB"> 
							<TD><%=RESOURCE.getString("CITY")%></TD> 
							<TD>
							  <!-- INPUT name="presentAddress.city" type="text" class="textBoxDashed" id="presentAddress.city" value="< % = memberForm.getPresentAddress().getCity() % >" size="33" maxlength="100"-->
							  <select class="mnd" name="presentAddress.city" id="presentAddress.city">
							  	<option value="">Select</option>
							  	<%
							  		if(memberForm.getPresentAddress().getCities() != null){
								  		for(ViewVyLookupCitiesDO prcity: memberForm.getPresentAddress().getCities()){
								  			if(prcity.getCityCode().equals(memberForm.getPresentAddress().getCity()))
								  				out.println("<option selected=\"selected\" value=\""+ prcity.getCityCode() +"\">"+ prcity.getCityName() +"</option>");
								  			else
								  				out.println("<option value=\""+ prcity.getCityCode() +"\">"+ prcity.getCityName() +"</option>");
								  		}
							  		}
							  	%>
							  </select>
							</TD> 
							<TD><%=RESOURCE.getString("STATE_OR_REGION")%></TD> 
							<TD> 
							  <!-- INPUT name="presentAddress.stateOrRegion" type="text" class="textBoxDashed" id="presentAddress.stateOrRegion" value="< % = memberForm.getPresentAddress().getStateOrRegion() % >" size="33" maxlength="100" -->
							  <select class="mnd" name="presentAddress.stateOrRegion" id="presentAddress.stateOrRegion">
							  	<option value="">Select</option>
							  	<%
						  		if(memberForm.getPresentAddress().getStates() != null){
							  		for(ViewVyLookupCitiesDO prstate: memberForm.getPresentAddress().getStates()){
							  			if(prstate.getStateCode().equals(memberForm.getPresentAddress().getStateOrRegion()))
							  				out.println("<option selected=\"selected\" value=\""+ prstate.getStateCode() +"\">"+ prstate.getStateName() +"</option>");
							  			else
							  				out.println("<option value=\""+ prstate.getStateCode() +"\">"+ prstate.getStateName() +"</option>");
							  		}
						  		}
							  	%>
							  </select>
							</TD> 
						  </TR> 
						  <TR bgcolor="#EBEBEB"> 
							<TD><%=RESOURCE.getString("DISTRICT_OR_COUNTY")%></TD> 
							<TD> 
							  <INPUT name="presentAddress.districtOrCounty" type="text" class="textBoxDashed mnd" id="presentAddress.districtOrCounty" value="<%=memberForm.getPresentAddress().getDistrictOrCounty() != null? memberForm.getPresentAddress().getDistrictOrCounty() : EMPTY%>" size="33" maxlength="100">
							</TD> 
							<TD><%=RESOURCE.getString("COUNTRY")%></TD> 
							<TD> 
							  <!-- INPUT name="presentAddress.country" type="text" class="textBoxDashed" id="presentAddress.country" value="< % = memberForm.getPresentAddress().getCountry() % >" size="33" maxlength="100"-->
							  <select class="mnd" name="presentAddress.country" id="presentAddress.country">
							  	<option value="">Select</option>
							  	<%
						  		if(memberForm.getPresentAddress().getCountries() != null){
							  		for(ViewVyLookupCitiesDO prcountry: memberForm.getPresentAddress().getCountries()){
							  			if(prcountry.getCountryCode().equals(memberForm.getPresentAddress().getCountry()))
							  				out.println("<option selected=\"selected\" value=\""+ prcountry.getCountryCode() +"\">"+ prcountry.getCountryName() +"</option>");
							  			else
							  				out.println("<option value=\""+ prcountry.getCountryCode() +"\">"+ prcountry.getCountryName() +"</option>");
							  		}
						  		}
							  	%>
							  </select>
							 </TD> 
						  </TR> 
						  <TR bgcolor="#EBEBEB"> 
							<TD><%=RESOURCE.getString("POST_BOX")%></TD> 
							<TD> 
							  <INPUT name="presentAddress.postBox" type="text" class="textBoxDashed" id="presentAddress.postBox" value="<%=memberForm.getPresentAddress().getPostBox() != null? memberForm.getPresentAddress().getPostBox() : EMPTY %>"  size="33" maxlength="35"> 
							</TD> 
							<TD><%=RESOURCE.getString("ZIP")%></TD> 
							<TD> 
							  <INPUT name="presentAddress.zip" type="text" class="textBoxDashed mnd" id="presentAddress.zip" value="<%=memberForm.getPresentAddress().getZip() != null? memberForm.getPresentAddress().getZip() : EMPTY %>" size="33" maxlength="35"> 
							</TD>
						  </tr>
						  <TR bgcolor="#EBEBEB"> 
							<TD><%=RESOURCE.getString("PHONE")%>&nbsp; 1</TD> 
							<TD> 
							  <input name="presentAddress.phone1" type="text" id="presentAddress.phone1" maxlength="20" value="<%=memberForm.getPresentAddress().getPhone1() != null? memberForm.getPresentAddress().getPhone1() : EMPTY %>" >
							</TD> 
							<TD><%=RESOURCE.getString("PHONE")%>&nbsp; 2</TD> 
							<TD> 
							  <input name="presentAddress.phone2" type="text" id="presentAddress.phone2" value="<%=memberForm.getPresentAddress().getPhone2() != null? memberForm.getPresentAddress().getPhone2() : EMPTY %>"  maxlength="20" size="23">
							</TD> 
						  </TR>
						  <TR bgcolor="#EBEBEB"> 
							  <TD><%=RESOURCE.getString("FAX")%></TD> 
							<TD> 
							  <INPUT name="presentAddress.fax" type="text" class="textBoxDashed" id="presentAddress.fax" value="<%=memberForm.getPresentAddress().getFax() != null? memberForm.getPresentAddress().getFax() : EMPTY%>" size="33" maxlength="20"> 
							  </TD> 
							  <td></td>
							  <td></td> 
						  </TR>
						</table>
					  </td> 
				  </TR> 
				</table>
			</div>
			<div>				
            	<table border="0" cellpadding="0" cellspacing="0" width="100%">
            	  <tr>
      				<td><a href="javascript:;" onClick="toggleOnOff('togrow22');"><img src="./pages/image_gif/oa.gif" alt="" name="off_add" width="100%" height="22" border="0"></a></td>
				  </tr>
				  <TR bgcolor="#EBEBEB" id="togrow22" style="<%=(memberForm.getOfficeAddress().getCountry()!=null&&!"".equals(memberForm.getOfficeAddress().getCountry())? "display:block":"display:none") %>">
				    <td> 
				  	  <table border="1" cellpadding="0" cellspacing="0" width="100%">
				  	    <tr> 
						  <TD width="20%">
							  <input type="hidden" name="officeAddress.addressType" id="officeAddress.addressType" value="<%=AddressTypeEnum.OFFICE.getName() != null? AddressTypeEnum.OFFICE.getName() : EMPTY%>" />
							  <INPUT name="officeAddress.addressId" type="hidden" id="officeAddress.addressId" value="<%=memberForm.getOfficeAddress().getAddressId() != null? memberForm.getOfficeAddress().getAddressId() : EMPTY%>">
							  <SELECT style="width: 70px;" name="officeAddress.namePrefix" id="officeAddress.namePrefix">
							  	<OPTION value="">Select</OPTION>
								<OPTION <%=("S/O".equals(memberForm.getOfficeAddress().getNamePrefix())?"selected='selected'" : "") %> value="S/O">S/O</OPTION>
								<OPTION <%=("H/O".equals(memberForm.getOfficeAddress().getNamePrefix())?"selected='selected'" : "") %> value="H/O">H/O</OPTION>
								<OPTION <%=("C/O".equals(memberForm.getOfficeAddress().getNamePrefix())?"selected='selected'" : "") %> value="C/O">C/O</OPTION>
								<OPTION <%=("W/O".equals(memberForm.getOfficeAddress().getNamePrefix())?"selected='selected'" : "") %> value="W/O">W/O</OPTION>
							  </SELECT>
							</TD> 
							<TD width="30%"> 
							  <INPUT name="officeAddress.coName" type="text" class="<%=("hi".equals(memberForm.getOfficeAddress().getPrintLanguage()))? "kd010":"" %>" id="officeAddress.coName" value="<%=memberForm.getOfficeAddress().getCoName()!= null? memberForm.getOfficeAddress().getCoName() : EMPTY %>" size="33" maxlength="150"> 
							  </TD> 
							<TD width="20%"><%=RESOURCE.getString("PRINT_LANGUAGE")%></TD> 
							<TD width="30%"> 
							  <SELECT name="officeAddress.printLanguage" id="officeAddress.printLanguage" onchange="changePrintLanguage('officeAddress')">
							  	<OPTION value="en" <%= ("en".equals(memberForm.getOfficeAddress().getPrintLanguage()))? "selected=\"selected\"":"" %> >English</OPTION>
							  	<OPTION value="hi" <%= ("hi".equals(memberForm.getOfficeAddress().getPrintLanguage()))? "selected=\"selected\"":"" %> >Hindi</OPTION>
							  </SELECT> 
							</TD>
						  </TR> 
						  <TR bgcolor="#EBEBEB"> 
							<TD><%=RESOURCE.getString("STREET")%>&nbsp; 1</TD> 
							<TD> 
							  <INPUT name="officeAddress.street1" type="text" class="textBoxDashed mnd" value="<%=memberForm.getOfficeAddress().getStreet1() != null? memberForm.getOfficeAddress().getStreet1() : EMPTY%>" id="officeAddress.street1" size="33" maxlength="255"> 
							</TD>
							<TD><%=RESOURCE.getString("STREET")%>&nbsp; 2</TD> 
							<TD>
							  <INPUT name="officeAddress.street2" type="text" class="textBoxDashed" value="<%=memberForm.getOfficeAddress().getStreet2() != null? memberForm.getOfficeAddress().getStreet2() : EMPTY%>" id="officeAddress.street2" size="33" maxlength="255"> 
							</TD>
						  </TR>
						  <TR bgcolor="#EBEBEB" id="officeAddress.lang" style="<%=("hi".equals(memberForm.getOfficeAddress().getPrintLanguage()))? "display:table-row":"display:none" %>"> 
							<TD><%=RESOURCE.getString("STREET_HINDI")%>&nbsp; 1</TD> 
							<TD> 
							  <INPUT name="officeAddress.streetHindi1" type="text" class="kd010 mnd" value="<%=memberForm.getOfficeAddress().getStreetHindi1() != null? memberForm.getOfficeAddress().getStreetHindi1() : EMPTY%>" id="officeAddress.streetHindi1" size="33" maxlength="255"> 
							</TD>
							<TD><%=RESOURCE.getString("STREET_HINDI")%>&nbsp; 2</TD> 
							<TD>
							  <INPUT name="officeAddress.streetHindi2" type="text" class="kd010" value="<%=memberForm.getOfficeAddress().getStreetHindi2() != null? memberForm.getOfficeAddress().getStreetHindi2() : EMPTY%>" id="officeAddress.streetHindi2" size="33" maxlength="255"> 
							</TD>
						  </TR>
						  <TR bgcolor="#EBEBEB"> 
							<TD><%=RESOURCE.getString("CITY")%></TD> 
							<TD>
							  <!-- INPUT name="officeAddress.city" type="text" class="textBoxDashed" id="officeAddress.city" value="< % = memberForm.getOfficeAddress().getCity() % >" size="33" maxlength="100"-->
							  <select class="mnd" name="officeAddress.city" id="officeAddress.city">
							  	<option value="">Select</option>
							  	<%
							  		if(memberForm.getOfficeAddress().getCities() != null){
								  		for(ViewVyLookupCitiesDO prcity: memberForm.getOfficeAddress().getCities()){
								  			if(prcity.getCityCode().equals(memberForm.getOfficeAddress().getCity()))
								  				out.println("<option selected=\"selected\" value=\""+ prcity.getCityCode() +"\">"+ prcity.getCityName() +"</option>");
								  			else
								  				out.println("<option value=\""+ prcity.getCityCode() +"\">"+ prcity.getCityName() +"</option>");
								  		}
							  		}
							  	%>
							  </select>
							</TD> 
							<TD><%=RESOURCE.getString("STATE_OR_REGION")%></TD> 
							<TD> 
							  <!--INPUT name="officeAddress.stateOrRegion" type="text" class="textBoxDashed" id="officeAddress.stateOrRegion" value="< % = memberForm.getOfficeAddress().getStateOrRegion() % >" size="33" maxlength="100" -->
							  <select class="mnd" name="officeAddress.stateOrRegion" id="officeAddress.stateOrRegion">
							  	<option value="">Select</option>
							  	<%
						  		if(memberForm.getOfficeAddress().getStates() != null){
							  		for(ViewVyLookupCitiesDO prstate: memberForm.getOfficeAddress().getStates()){
							  			if(prstate.getStateCode().equals(memberForm.getOfficeAddress().getStateOrRegion()))
							  				out.println("<option selected=\"selected\" value=\""+ prstate.getStateCode() +"\">"+ prstate.getStateName() +"</option>");
							  			else
							  				out.println("<option value=\""+ prstate.getStateCode() +"\">"+ prstate.getStateName() +"</option>");
							  		}
						  		}
							  	%>
							  </select>
							</TD> 
						  </TR> 
						  <TR bgcolor="#EBEBEB"> 
							<TD><%=RESOURCE.getString("DISTRICT_OR_COUNTY")%></TD> 
							<TD> 
							  <INPUT name="officeAddress.districtOrCounty" type="text" class="textBoxDashed" id="officeAddress.districtOrCounty" value="<%=memberForm.getOfficeAddress().getDistrictOrCounty() != null? memberForm.getOfficeAddress().getDistrictOrCounty() : EMPTY%>" size="33" maxlength="100">
							</TD> 
							<TD><%=RESOURCE.getString("COUNTRY")%></TD> 
							<TD> 
							  <!--INPUT name="officeAddress.country" type="text" class="textBoxDashed" id="officeAddress.country" value="< % = memberForm.getOfficeAddress().getCountry() % >" size="33" maxlength="100"-->
							  <select class="mnd" name="officeAddress.country" id="officeAddress.country">
							  	<option value="">Select</option>
							  	<%
						  		if(memberForm.getOfficeAddress().getCountries() != null){
							  		for(ViewVyLookupCitiesDO prcountry: memberForm.getOfficeAddress().getCountries()){
							  			if(prcountry.getCountryCode().equals(memberForm.getOfficeAddress().getCountry()))
							  				out.println("<option selected=\"selected\" value=\""+ prcountry.getCountryCode() +"\">"+ prcountry.getCountryName() +"</option>");
							  			else
							  				out.println("<option value=\""+ prcountry.getCountryCode() +"\">"+ prcountry.getCountryName() +"</option>");
							  		}
						  		}
							  	%>
							  </select>
							 </TD> 
						  </TR> 
						  <TR bgcolor="#EBEBEB"> 
							<TD><%=RESOURCE.getString("POST_BOX")%></TD> 
							<TD> 
							  <INPUT name="officeAddress.postBox" type="text" class="textBoxDashed" id="officeAddress.postBox" value="<%=memberForm.getOfficeAddress().getPostBox() != null? memberForm.getOfficeAddress().getPostBox() : EMPTY %>"  size="33" maxlength="35"> 
							</TD> 
							<TD><%=RESOURCE.getString("ZIP")%></TD> 
							<TD> 
							  <INPUT name="officeAddress.zip" type="text" class="textBoxDashed mnd" id="officeAddress.zip" value="<%=memberForm.getOfficeAddress().getZip() != null? memberForm.getOfficeAddress().getZip() : EMPTY%>" size="33" maxlength="35"> 
							</TD>
						  </tr>
						  <TR bgcolor="#EBEBEB"> 
							<TD><%=RESOURCE.getString("PHONE")%>&nbsp; 1</TD> 
							<TD> 
							  <input name="officeAddress.phone1" type="text" id="officeAddress.phone1" maxlength="20" value="<%=memberForm.getOfficeAddress().getPhone1() != null? memberForm.getOfficeAddress().getPhone1() : EMPTY%>" >
							</TD> 
							<TD><%=RESOURCE.getString("PHONE")%>&nbsp; 2</TD> 
							<TD> 
							  <input name="officeAddress.phone2" type="text" id="officeAddress.phone2" value="<%=memberForm.getOfficeAddress().getPhone2() != null? memberForm.getOfficeAddress().getPhone2() : EMPTY%>"  maxlength="20" size="23">
							</TD> 
						  </TR> 
						  <TR bgcolor="#EBEBEB"> 
							  <TD><%=RESOURCE.getString("FAX")%></TD> 
							<TD> 
							  <INPUT name="officeAddress.fax" type="text" class="textBoxDashed" id="officeAddress.fax" value="<%=memberForm.getOfficeAddress().getFax() != null? memberForm.getOfficeAddress().getFax() : EMPTY%>" size="33" maxlength="20"> 
							  </TD>
							  <td></td>
							  <td></td> 
						  </TR> 
						</table>
					  </td>
				  </TR> 
				</table>
			</div>
			<div>
            	<table border="0" cellpadding="0" cellspacing="0" width="100%">
            	  <tr>
      				<td><a href="javascript:;" onClick="toggleOnOff('togrow23');"><img src="./pages/image_gif/par.gif" alt="" name="pmt_add" width="100%" height="22" border="0"></a></td>
				  </tr>
				  <TR bgcolor="#EBEBEB" id="togrow23" style="<%=(memberForm.getPermanentAddress().getCountry()!=null&&!"".equals(memberForm.getPermanentAddress().getCountry())? "display:block":"display:none") %>"> 
				    <td> 
				  	  <table border="1" cellpadding="0" cellspacing="0" width="100%">
				  	    <tr> 
						  <TD width="20%">
							  <input type="hidden" name="permanentAddress.addressType" id="permanentAddress.addressType" value="<%=AddressTypeEnum.PERMANENT.getName()!= null? AddressTypeEnum.PERMANENT.getName() : EMPTY %>" />
							  <INPUT name="permanentAddress.addressId" type="hidden" id="permanentAddress.addressId" value="<%=memberForm.getPermanentAddress().getAddressId()!= null? memberForm.getPermanentAddress().getAddressId() : EMPTY %>">
							  <SELECT style="width: 70px;" name="permanentAddress.namePrefix" id="permanentAddress.namePrefix">
							  	<OPTION value="">Select</OPTION>
								<OPTION <%=("S/O".equals(memberForm.getPermanentAddress().getNamePrefix())?"selected='selected'" : "") %> value="S/O">S/O</OPTION>
								<OPTION <%=("H/O".equals(memberForm.getPermanentAddress().getNamePrefix())?"selected='selected'" : "") %> value="H/O">H/O</OPTION>
								<OPTION <%=("C/O".equals(memberForm.getPermanentAddress().getNamePrefix())?"selected='selected'" : "") %> value="C/O">C/O</OPTION>
								<OPTION <%=("W/O".equals(memberForm.getPermanentAddress().getNamePrefix())?"selected='selected'" : "") %> value="W/O">W/O</OPTION>
							  </SELECT>
							</TD> 
							<TD width="30%"> 
							  <INPUT name="permanentAddress.coName" type="text" class="<%=("hi".equals(memberForm.getPermanentAddress().getPrintLanguage()))? "kd010":"" %>" id="permanentAddress.coName" value="<%=memberForm.getPermanentAddress().getCoName() != null? memberForm.getPermanentAddress().getCoName() : EMPTY %>" size="33" maxlength="150"> 
							  </TD> 
							<TD width="20%"><%=RESOURCE.getString("PRINT_LANGUAGE")%></TD> 
							<TD width="30%"> 
							  <SELECT name="permanentAddress.printLanguage" id="permanentAddress.printLanguage" onchange="changePrintLanguage('permanentAddress')">
							  	<OPTION value="en" <%= ("en".equals(memberForm.getPermanentAddress().getPrintLanguage()))? "selected=\"selected\"":"" %> >English</OPTION>
							  	<OPTION value="hi" <%= ("hi".equals(memberForm.getPermanentAddress().getPrintLanguage()))? "selected=\"selected\"":"" %> >Hindi</OPTION>
							  </SELECT> 
							</TD>
						  </TR> 
						  <TR bgcolor="#EBEBEB"> 
							<TD><%=RESOURCE.getString("STREET")%>&nbsp; 1</TD> 
							<TD> 
							  <INPUT name="permanentAddress.street1" type="text" class="textBoxDashed mnd" value="<%=memberForm.getPermanentAddress().getStreet1() != null? memberForm.getPermanentAddress().getStreet1() : EMPTY%>" id="permanentAddress.street1" size="33" maxlength="255"> 
							</TD>
							<TD><%=RESOURCE.getString("STREET")%>&nbsp; 2</TD> 
							<TD>
							  <INPUT name="permanentAddress.street2" type="text" class="textBoxDashed" value="<%=memberForm.getPermanentAddress().getStreet2() != null? memberForm.getPermanentAddress().getStreet2() : EMPTY%>" id="permanentAddress.street2" size="33" maxlength="255"> 
							</TD>
						  </TR>
						  <TR bgcolor="#EBEBEB" id="permanentAddress.lang" style="<%=("hi".equals(memberForm.getPermanentAddress().getPrintLanguage()))? "display:table-row":"display:none" %>"> 
							<TD><%=RESOURCE.getString("STREET_HINDI")%>&nbsp; 1</TD> 
							<TD> 
							  <INPUT name="permanentAddress.streetHindi1" type="text" class="kd010 mnd" value="<%=memberForm.getPermanentAddress().getStreetHindi1() != null? memberForm.getPermanentAddress().getStreetHindi1() : EMPTY%>" id="permanentAddress.streetHindi1" size="33" maxlength="255"> 
							</TD>
							<TD><%=RESOURCE.getString("STREET_HINDI")%>&nbsp; 2</TD> 
							<TD>
							  <INPUT name="permanentAddress.streetHindi2" type="text" class="kd010" value="<%=memberForm.getPermanentAddress().getStreetHindi2() != null? memberForm.getPermanentAddress().getStreetHindi2() : EMPTY%>" id="permanentAddress.streetHindi2" size="33" maxlength="255"> 
							</TD>
						  </TR>
						  <TR bgcolor="#EBEBEB"> 
							<TD><%=RESOURCE.getString("CITY")%></TD> 
							<TD>
							  <!-- INPUT name="permanentAddress.city" type="text" class="textBoxDashed" id="permanentAddress.city" value="<%=memberForm.getPermanentAddress().getCity() != null? memberForm.getPermanentAddress().getCity() : EMPTY%>" size="33" maxlength="100" -->
							  <select class="mnd" name="permanentAddress.city" id="permanentAddress.city">
							  	<option value="">Select</option>
							  	<%
							  		if(memberForm.getPermanentAddress().getCities() != null){
								  		for(ViewVyLookupCitiesDO prcity: memberForm.getPermanentAddress().getCities()){
								  			if(prcity.getCityCode().equals(memberForm.getPermanentAddress().getCity()))
								  				out.println("<option selected=\"selected\" value=\""+ prcity.getCityCode() +"\">"+ prcity.getCityName() +"</option>");
								  			else
								  				out.println("<option value=\""+ prcity.getCityCode() +"\">"+ prcity.getCityName() +"</option>");
								  		}
							  		}
							  	%>
							  	</select>
							</TD> 
							<TD><%=RESOURCE.getString("STATE_OR_REGION")%></TD> 
							<TD> 
							  <!--INPUT name="permanentAddress.stateOrRegion" type="text" class="textBoxDashed" id="permanentAddress.stateOrRegion" value="< % = memberForm.getPermanentAddress().getStateOrRegion() % >" size="33" maxlength="100"-->
							  <select class="mnd" name="permanentAddress.stateOrRegion" id="permanentAddress.stateOrRegion">
							  	<option value="">Select</option>
							  	<%
						  		if(memberForm.getPermanentAddress().getStates() != null){
							  		for(ViewVyLookupCitiesDO prstate: memberForm.getPermanentAddress().getStates()){
							  			if(prstate.getStateCode().equals(memberForm.getPermanentAddress().getStateOrRegion()))
							  				out.println("<option selected=\"selected\" value=\""+ prstate.getStateCode() +"\">"+ prstate.getStateName() +"</option>");
							  			else
							  				out.println("<option value=\""+ prstate.getStateCode() +"\">"+ prstate.getStateName() +"</option>");
							  		}
						  		}
							  	%>
							  </select>
							</TD> 
						  </TR> 
						  <TR bgcolor="#EBEBEB"> 
							<TD><%=RESOURCE.getString("DISTRICT_OR_COUNTY")%></TD> 
							<TD> 
							  <INPUT name="permanentAddress.districtOrCounty" type="text" class="textBoxDashed" id="permanentAddress.districtOrCounty" value="<%=memberForm.getPermanentAddress().getDistrictOrCounty() != null? memberForm.getPermanentAddress().getDistrictOrCounty() : EMPTY%>" size="33" maxlength="100">
							</TD> 
							<TD><%=RESOURCE.getString("COUNTRY")%></TD> 
							<TD> 
							  <!--INPUT name="permanentAddress.country" type="text" class="textBoxDashed" id="permanentAddress.country" value="<%=memberForm.getPermanentAddress().getCountry()!= null? memberForm.getPermanentAddress().getCountry() : EMPTY %>" size="33" maxlength="100"-->
							  <select class="mnd" name="permanentAddress.country" id="permanentAddress.country">
							  	<option value="">Select</option>
							  	<%
						  		if(memberForm.getPermanentAddress().getCountries() != null){
							  		for(ViewVyLookupCitiesDO prcountry: memberForm.getPermanentAddress().getCountries()){
							  			if(prcountry.getCountryCode().equals(memberForm.getPermanentAddress().getCountry()))
							  				out.println("<option selected=\"selected\" value=\""+ prcountry.getCountryCode() +"\">"+ prcountry.getCountryName() +"</option>");
							  			else
							  				out.println("<option value=\""+ prcountry.getCountryCode() +"\">"+ prcountry.getCountryName() +"</option>");
							  		}
						  		}
							  	%>
							  </select>
							 </TD> 
						  </TR> 
						  <TR bgcolor="#EBEBEB"> 
							<TD><%=RESOURCE.getString("POST_BOX")%></TD> 
							<TD> 
							  <INPUT name="permanentAddress.postBox" type="text" class="textBoxDashed" id="permanentAddress.postBox" value="<%=memberForm.getPermanentAddress().getPostBox()!= null? memberForm.getPermanentAddress().getPostBox() : EMPTY %>"  size="33" maxlength="35"> 
							</TD> 
							<TD><%=RESOURCE.getString("ZIP")%></TD> 
							<TD> 
							  <INPUT name="permanentAddress.zip" type="text" class="textBoxDashed mnd" id="permanentAddress.zip" value="<%=memberForm.getPermanentAddress().getZip() != null? memberForm.getPermanentAddress().getZip() : EMPTY%>" size="33" maxlength="35"> 
							</TD>
						  </tr>
						  <TR bgcolor="#EBEBEB"> 
							  <TD><%=RESOURCE.getString("FAX")%></TD> 
							<TD> 
							  <INPUT name="permanentAddress.fax" type="text" class="textBoxDashed" id="permanentAddress.fax" value="<%=memberForm.getPermanentAddress().getFax() != null? memberForm.getPermanentAddress().getFax() : EMPTY%>" size="33" maxlength="20"> 
							  </TD>
							  <td></td> 
							  <td></td> 
						  </TR> 
						  <TR bgcolor="#EBEBEB"> 
							<TD><%=RESOURCE.getString("PHONE")%>&nbsp; 1</TD> 
							<TD> 
							  <input name="permanentAddress.phone1" type="text" id="permanentAddress.phone1" maxlength="20" value="<%=memberForm.getPermanentAddress().getPhone1() != null? memberForm.getPermanentAddress().getPhone1() : EMPTY%>" >
							</TD> 
							<TD><%=RESOURCE.getString("PHONE")%>&nbsp; 2</TD> 
							<TD> 
							  <input name="permanentAddress.phone2" type="text" id="permanentAddress.phone2" value="<%=memberForm.getPermanentAddress().getPhone2() != null? memberForm.getPermanentAddress().getPhone2() : EMPTY%>"  maxlength="20" size="23">
							</TD> 
						  </TR> 
						</table>
					 </td> 
				  </TR> 
				</table>
				</div>
			</TD>
		  </TR>
          <!-- TR> 
            <TD>
				<a href="javascript:;" onclick="toggleOnOff('togrow3');"><img src="./pages/image_gif/fi.gif" alt="" name="family_info" wid style="display:block" border="0"></a>
			</TD>
		  </TR> 
          <TR bgcolor="#EBEBEB" id="togrow3" style="display:block"> 
            <TD>
            	<table border="1" cellpadding="0" cellspacing="0" width="100%">
            	  <tr>
            		<td colspan="5">
						< % = RESOURCE.getString("ANY_RELATIVE_VY") % >
              		</td>
              	  </tr>
				  <TR>
					<TD><INPUT name="fa_info_chk" type="checkbox" id="fa_info_chk"></TD>
					<TD>&nbsp;&nbsp;&nbsp;</TD>
					<TD><INPUT name="member_name" type="text" class="textBoxDashed" id="member_name" size="33" maxlength="35"></TD>
					<TD><img src="image_gif/find.png" width="16" height="16"></TD>
					<TD> 
			              <SELECT name="relationship" class="combo" id="relationship" tabindex="87"> 
			                <OPTION value="Select">Relationship</OPTION> 
			                <OPTION value="Fat">Father</OPTION> 
			                <OPTION value="Moth">Mother</OPTION> 
			                <OPTION value="Bro">Brother</OPTION> 
							<OPTION value="Sis">Sister</OPTION>
			              </SELECT>
					</TD>
				  </TR>              	  
		          <TR bgcolor="#EBEBEB"> 
		            <TD>
						<TABLE id="dataTable" width="416" border="0">
							<TBODY>
							</TBODY>
						</TABLE>
						<INPUT type="button" value="Add Member" onClick="addRow('dataTable')">
				     	<INPUT type="button" value="Delete Member" onClick="deleteRow('dataTable')">
				    </TD> 
		          </TR> 
              	</table>
              </TD> 
          </TR-->
        <tr>
      	 	<td style="background:transparent url('./pages/image_gif/tb_header_blank_strip.gif') repeat-x top left;"><a href="javascript:;" 
		 style="background:transparent url('./pages/image_gif/tb_header_blank.jpg') no-repeat top right; color:#efefef; padding:3px 30px 3px 10px; float:left; font-size:14px;text-decoration:none;" onClick="toggleOnOff('togrow5')"><%=RESOURCE.getString("MAGAZINE_SUBSCRIPTION") %></a></td>
  		</tr>
        <TR id="togrow5" style="display:block"> 
            <TD>
            <% 
	    		List<MagazineForm> magazines = memberForm.getMagazines();
            	AddressForm addr = null;
            	int mzI = -1;
            	if(magazines !=null) {
	            	for(MagazineForm mzForm : magazines){
	            		mzI++;
	            		if(mzI == memberForm.getMagazineSubscriptionCnt()) break;
            		%>
	                 <div>
					  <INPUT name="magazines[<%=mzI %>].subscriptionId" type="hidden" id="magazines.[<%=mzI %>]subscriptionId" value="<%=mzForm.getSubscriptionId() %>">
					  <input type="hidden" name="magazines[<%=mzI %>].patrikaId" id="magazines[<%=mzI %>].patrikaId" value="<%=mzForm.getPatrikaId() %>" />
					  <input type="hidden" name="magazines[<%=mzI %>].patrikaName" id="magazines[<%=mzI %>].patrikaName" value="<%=mzForm.getPatrikaName() %>" />
					  <input type="hidden" name="magazines[<%=mzI %>].vyId" id="magazines[<%=mzI %>].vyId" value="<%=mzForm.getVyId() %>" />
					  <input type="hidden" name="magazines[<%=mzI %>].address.addressId" id="magazines[<%=mzI %>].address.addressId" value="<%=mzForm.getAddress().getAddressId() %>" />
					  <input type="hidden" name="magazines[<%=mzI %>].address.addressType" id="magazines[<%=mzI %>].address.addressType" value="<%=mzForm.getAddress().getAddressType() %>" />
					  <input type="hidden" name="magazines[<%=mzI %>].address.country" id="magazines[<%=mzI %>].address.country" value="<%=mzForm.getAddress().getCountry() %>" />
					  <input type="hidden" name="magazines[<%=mzI %>].address.stateOrRegion" id="magazines[<%=mzI %>].address.stateOrRegion" value="<%=mzForm.getAddress().getStateOrRegion() %>" />
					  <input type="hidden" name="magazines[<%=mzI %>].weekOffsetIndex" id="magazines[<%=mzI %>].weekOffsetIndex" value="<%=mzForm.getWeekOffsetIndex() %>" />
					  <input type="hidden" name="magazines[<%=mzI %>].patrikaCost" id="magazines[<%=mzI %>].patrikaCost" value="<%=request.getParameter("magazines["+mzI+"].patrikaCost") %>" />
	                	<table border="0" cellpadding="0" cellspacing="0" width="100%">
	                	  <tr>
	          				<td style="background:transparent url('./pages/image_gif/tb_header_blank_strip.gif') repeat-x top left;"><a href="javascript:;" 
	    		 style="background:transparent url('./pages/image_gif/tb_header_blank.jpg') no-repeat top right;  color:#efefef; padding:3px 30px 3px 10px; float:left; font-size:14px;text-decoration:none;" onClick="toggleOnOff('togrow5<%=mzI%>')"><%=(mzForm.getSubscriptionId()!=null&&!"".equals(mzForm.getSubscriptionId().trim())?mzForm.getPatrikaName():RESOURCE.getString("ADD")) + " ("+ (mzForm.getSubscriptionId() !=null?mzForm.getSubscriptionId():"")+ ")" %></a></td>

	    				  </tr>
	    				  <TR bgcolor="#EBEBEB" id="togrow5<%=mzI%>" style="display:block">
	    				  	<td>
	    				  	  <table border="1" cellpadding="0" cellspacing="0" width="100%">
	    				  	    <tr> 
	    						  <TD width="20%">
	    						  	<%=RESOURCE.getString("PATRIKA")%>
	    							</td>
	    							<td width="30%">
	    							  <SELECT class="mnd" name="mzPatrika<%=mzI %>" id="mzPatrika<%=mzI %>" onchange="changePatrika('mzPatrika<%=mzI %>',<%=mzI %>);">
	    							  	<OPTION value="">Select</OPTION>
	    							  	<%
	    							  		Map<String, List<MntnPatrikaPeriodForm>> patrikas = memberForm.getPatrikas();
	    							  		Entry<String, List<MntnPatrikaPeriodForm>> selected = null;
	    							  		
	    							  		if(patrikas != null){
		    							  		Set<Entry<String,List<MntnPatrikaPeriodForm>>> patrikaSet = patrikas.entrySet();
		    							  		for(Entry<String, List<MntnPatrikaPeriodForm>> patrika : patrikaSet){
		    							  			selected = patrika;
		    							  			MntnPatrikaPeriodForm patForm = patrika.getValue().get(0);
		    							  			if(patForm.getPatrikaId().toString().equals(mzForm.getPatrikaId()))
			    							  			out.print("<option selected=\"selected\" value=\""+ patForm.getPatrikaId()+"~"+patForm.getCost()+"~"+patForm.getWeekOffsetIndex()+"~"+ patForm.getPatrikaName() +"\">"+ patForm.getPatrikaName() +"</option>");
		    							  			else
			    							  			out.print("<option value=\""+ patForm.getPatrikaId()+"~"+patForm.getCost()+"~"+patForm.getWeekOffsetIndex()+"~"+ patForm.getPatrikaName() +"\">"+ patForm.getPatrikaName() +"</option>");
		    							  		}
	    							  		}
	    							  	%>
	    							  </SELECT>
	    							</TD> 
	    							<TD><%=RESOURCE.getString("PATRIKA_PERIOD")%></TD> 
    							    <td width="50%" colspan="2" id="mzAddress<%=mzI %>_td">
    							    	<%
    							    	boolean periodFound = false;
    							    	if(selected != null) {
    							    		for(MntnPatrikaPeriodForm periodForm : selected.getValue()){
    							    			if(mzForm.getAddress() !=null && periodForm.getCountryCode().equals(mzForm.getAddress().getCountry())){
    							    				periodFound = true;
		    							    		%>
		    							    			<input class="mnd" type="radio" <%=(periodForm.getPeriodMonth()==mzForm.getPatrikaPeriod())?"checked=\"true\"":"" %> id="magazines<%=mzI %>Period" name="magazines<%=mzI %>Period" value="<%=periodForm.getPeriodMonth() %>" onclick="selectPeriod(<%=mzI %>);" />&nbsp;<%=periodForm.getPeriodName() %>&nbsp;&nbsp;
		    							    		<%
    							    			}
    							    		}
    							    		if(!periodFound){
	    							    		for(MntnPatrikaPeriodForm periodForm : selected.getValue()){
	    							    			if(periodForm.getCountryCode().equals("-1")){
			    							    		%>
			    							    			<input class="mnd" type="radio" <%=(periodForm.getPeriodMonth()==mzForm.getPatrikaPeriod())?"checked=\"true\"":"" %> id="magazines<%=mzI %>Period" name="magazines<%=mzI %>Period" value="<%=periodForm.getPeriodMonth() %>" onclick="selectPeriod(<%=mzI %>);" />&nbsp;<%=periodForm.getPeriodName() %>&nbsp;&nbsp;
			    							    		<%
	    							    			}
	    							    		}
    							    		}
    							    	}
    							    	%>
    							    </td>
    							  </tr>
    							  <tr> 
	    							<td> 
	    						  		<%=RESOURCE.getString("DELIVERY_ADDRESS")%>
	    						  	</td>
	    						  	<td>
	    							  <SELECT class="mnd" name="mzAddress<%=mzI %>" id="mzAddress<%=mzI %>" onchange="changeAddress('mzAddress<%=mzI %>',<%=mzI %>);">
	    							  	<OPTION value="">Select</OPTION>
	    							  	<%
	    							  		addr = memberForm.getOfficeAddress();
	    							  	%>
	    							  	<option <%=(addr.getAddressType().equals(mzForm.getAddress().getAddressType())?"selected":"")%> value="<%= addr.getAddressId()+"~"+addr.getAddressType()+"~"+addr.getCountry()+"~"+addr.getStateOrRegion()+"~"+addr.getDistrictOrCounty() %>">
	    							  		<%= addr.getAddressType()+" : "+addr.getCountry()+", "+addr.getStateOrRegion()+", "+addr.getDistrictOrCounty() %>
	    							  	</option>

	    							  	<%
	    							  		addr = memberForm.getPermanentAddress();
	    							  	%>
	    							  	<option <%=(addr.getAddressType().equals(mzForm.getAddress().getAddressType())?"selected":"")%> value="<%= addr.getAddressId()+"~"+addr.getAddressType()+"~"+addr.getCountry()+"~"+addr.getStateOrRegion()+"~"+addr.getDistrictOrCounty() %>">
	    							  		<%= addr.getAddressType()+" : "+addr.getCountry()+", "+addr.getStateOrRegion()+", "+addr.getDistrictOrCounty() %>
	    							  	</option>

	    							  	<%
	    							  		addr = memberForm.getPresentAddress();
	    							  	%>
	    							  	<option <%=(addr.getAddressType().equals(mzForm.getAddress().getAddressType())?"selected":"")%> value="<%= addr.getAddressId()+"~"+addr.getAddressType()+"~"+addr.getCountry()+"~"+addr.getStateOrRegion()+"~"+addr.getDistrictOrCounty() %>">
	    							  		<%= addr.getAddressType()+" : "+addr.getCountry()+", "+addr.getStateOrRegion()+", "+addr.getDistrictOrCounty() %>
	    							  	</option>

	    							  </SELECT>
	    							  </TD>
	    							  <td width="15%"></td>
	    							  <td width="35%"></td> 
	    						  </TR> 
	    						  <TR bgcolor="#EBEBEB"> 
	    							<TD><%=RESOURCE.getString("START_DATE")%></TD> 
	    							<TD> 
	    							  <INPUT class="mnd" name="magazines[<%=mzI %>].startDate" type="text" class="textBoxDashed" value="<%=mzForm.getStartDate() %>" id="magazines[<%=mzI %>].startDate" readonly="readonly" size="33" maxlength="10">
	    							  <script>
	    							    var jsdp<%=mzI %> = new JsDatePick({
	    							        useMode:2,
	    							        target:"magazines[<%=mzI %>].startDate",
	    							        dateFormat:"%m/%d/%Y",
	    							        isStripped:false,
	    							        selectedDate:null,
	    							        yearsRange: new Array(TODAY.getFullYear()-1,TODAY.getFullYear()+15),
	    							        limitToToday:false,
	    							        cellColorScheme:'ocean_blue'
	    							    });
	    							    jsdp<%=mzI %>.addOnSelectedDelegate(function(){ selectPeriod(<%=mzI %>); });
	    							    
	    							  </script> 
	    							</TD>
	    							<TD><%=RESOURCE.getString("END_DATE")%></TD> 
	    							<TD>
	    							  <INPUT name="magazines[<%=mzI %>].endDate" type="text" class="textBoxDashed" value="<%=mzForm.getEndDate() %>" id="magazines[<%=mzI %>].endDate" readonly="readonly" size="33" maxlength="10"> 
	    							  <!-- script>
	    							    new JsDatePick({
	    							        useMode:2,
	    							        target:"magazines[<%=mzI %>].endDate",
	    							        dateFormat:"%m/%d/%Y",
	    							        isStripped:false,
	    							        selectedDate:null,
	    							        yearsRange: new Array(TODAY.getFullYear()-1,TODAY.getFullYear()+15),
	    							        limitToToday:false,
	    							        cellColorScheme:'ocean_blue',
	    							    });
	    							  </script--> 
	    							</TD>
	    						  </TR>
	    						  <TR bgcolor="#EBEBEB"> 
	    							<TD><%=RESOURCE.getString("DELIVERY_MODE")%></TD> 
	    							<TD>
	    							  <SELECT class="mnd" name="magazines[<%=mzI %>].deliveryMode" id="magazines[<%=mzI %>].deliveryMode">
	    							  	<option value="">Select</option>
	    							  	<%
	    							  		Map<String, MntnDeliveryModeForm> deliveryMode = memberForm.getDeliveryModes();
	    							  		if(deliveryMode != null){
		    							  		Set<Entry<String,MntnDeliveryModeForm>> dlmodeSet = deliveryMode.entrySet();
		    							  		for(Entry<String, MntnDeliveryModeForm> dlmode : dlmodeSet){
		    							  			if("true".equalsIgnoreCase(dlmode.getValue().getIsActive())){
			    							  			if(dlmode.getValue().getDeliveryModeCode().equals(mzForm.getDeliveryMode()))
			    							  				out.print("<option selected=\"selected\" value=\""+ dlmode.getKey() +"\">"+ dlmode.getValue().getDeliveryModeName() +"</option>");
			    							  			else
			    							  				out.print("<option value=\""+ dlmode.getKey() +"\">"+ dlmode.getValue().getDeliveryModeName() +"</option>");
		    							  			}
		    							  		}
	    							  		}
	    							  	%>
	    							  </SELECT>
	    							</TD>
	    							<TD>
	    							</TD>
	    							<TD>
	    							</TD> 
	    						  </TR> 
	    						  <TR bgcolor="#EBEBEB"> 
	    							<TD><%=RESOURCE.getString("RECEIPT_NO")%></TD> 
	    							<TD> 
	    							  <INPUT name="magazines[<%=mzI %>].receiptNo" type="text" class="textBoxDashed mnd" id="magazines[<%=mzI %>].receiptNo" value="<%=mzForm.getReceiptNo() %>" size="33" maxlength="20">
	    							</TD> 
	    							<TD><%=RESOURCE.getString("RECEIPT_DATE")%></TD> 
	    							<TD> 
	    							  <INPUT name="magazines[<%=mzI %>].receiptDate" type="text" readonly="readonly" class="textBoxDashed mnd" id="magazines[<%=mzI %>].receiptDate" value="<%=mzForm.getReceiptDate() %>" size="33" maxlength="10">
	    							  <script>
	    							    new JsDatePick({
	    							        useMode:2,
	    							        target:"magazines[<%=mzI %>].receiptDate",
	    							        dateFormat:"%m/%d/%Y",
	    							        isStripped:false,
	    							        selectedDate:null,
	    							        yearsRange: new Array(TODAY.getFullYear()-15,TODAY.getFullYear()),
	    							        limitToToday:true,
	    							        cellColorScheme:'ocean_blue'
	    							    });
	    							  </script> 
	    							</TD> 
	    						  </TR> 
	    						  <TR bgcolor="#EBEBEB"> 
	    							<TD><%=RESOURCE.getString("QUANTITY")%></TD> 
	    							<TD> 
	    							  <INPUT name="magazines[<%=mzI %>].quantity" type="text" class="textBoxDashed mnd" id="magazines[<%=mzI %>].quantity" onblur="changeQuantity('magazines[<%=mzI %>].quantity',<%=mzI %>)" value="<%=mzForm.getQuantity() %>"  size="15" maxlength="5"> 
	    							</TD> 
	    							<TD><%=RESOURCE.getString("TOTAL_AMOUNT")%></TD> 
	    							<TD> 
	    							  <INPUT name="magazines[<%=mzI %>].totalAmount" type="text" class="textBoxDashed" id="magazines[<%=mzI %>].totalAmount" value="<%=mzForm.getTotalAmount() %>"  size="20" maxlength="10"> 
	    							</TD> 
	    						  </tr>
	    						  <TR bgcolor="#EBEBEB"> 
	    							<TD><%=RESOURCE.getString("PAID_AMOUNT")%></TD> 
	    							<TD> 
	    							  <INPUT name="magazines[<%=mzI %>].paidAmount" type="text" class="textBoxDashed" id="magazines[<%=mzI %>].paidAmount" value="<%=mzForm.getPaidAmount() %>"  size="20" maxlength="10"> 
	    							</TD> 
	    						  </TR>
	    						  <TR bgcolor="#EBEBEB"> 
	    							  <TD><%=RESOURCE.getString("REF_VY_ID")%></TD> 
	    							  <TD> 
	    							  	<INPUT name="magazines[<%=mzI %>].refVyId" type="text" class="textBoxDashed" id="magazines[<%=mzI %>].refVyId" value="<%=mzForm.getRefVyId() != null? mzForm.getRefVyId() : EMPTY%>" size="33" maxlength="50"> 
	    							  </TD> 
	    							  <TD><%=RESOURCE.getString("DELETE")%></TD> 
	    							  <TD> 
	    							  	<input type="radio" name="magazines[<%=mzI %>].isActive" id="magazines[<%=mzI %>].isActive1" <%=("true".equalsIgnoreCase(mzForm.getIsActive())?"checked" : "")%> value="false" /><%=RESOURCE.getString("YES") %>
	    							  	<input type="radio" name="magazines[<%=mzI %>].isActive" id="magazines[<%=mzI %>].isActive2" <%=("true".equalsIgnoreCase(mzForm.getIsActive())?"checked" : "")%> value="true" /><%=RESOURCE.getString("NO") %>
	    							  </TD> 
	    						  </TR>
	    						  <TR bgcolor="#EBEBEB"> 
	    							  <TD><%=RESOURCE.getString("ANY_INSTRUCTION")%></TD> 
	    							  <TD> 
	    							  	<INPUT name="magazines[<%=mzI %>].instruction" type="text" class="textBoxDashed" id="magazines[<%=mzI %>].instruction" value="<%=mzForm.getInstruction() != null? mzForm.getInstruction() : EMPTY%>" size="33" maxlength="200"> 
	    							  </TD> 
	    							  <TD></TD>
	    							  <TD></TD> 
	    						  </TR>
	    						</table>
	    					  </td> 
	    				  </TR> 
	    				</table>
	    			  </div>
	            	<%	
	            	}
				}
            %>
            	<div style="padding:5px 30px 15px 30px">
            		<input type="button" onclick="addPatrika()" value="<%=RESOURCE.getString("ADD_SUBSCRIPTION") %>" />
            	</div>
			</td>
		  </tr>
        <tr>
      	 	<td style="background:transparent url('./pages/image_gif/tb_header_blank_strip.gif') repeat-x top left;"><a href="javascript:;" 
		 style="background:transparent url('./pages/image_gif/tb_header_blank.jpg') no-repeat top right; color:#efefef; padding:3px 30px 3px 10px; float:left; font-size:14px;text-decoration:none;" onClick="toggleOnOff('togrow6')"><%=RESOURCE.getString("DABBA_SUBSCRIPTION") %></a></td>
  		</tr>
        <TR id="togrow6" style="display:block"> 
            <TD>
            <% 
	    		List<DabbaForm> dabbas = memberForm.getDabbas();
            	addr = null;
            	int daI = -1;
            	if(dabbas !=null) {
	            	for(DabbaForm daForm : dabbas){
	            		daI++;
	            		if(daI == memberForm.getDabbaSubscriptionCnt()) break;
            		%>
	                 <div>
					  <INPUT name="dabbas[<%=daI %>].dabbaSubscriptionId" type="hidden" id="dabbas[<%=daI %>].dabbaSubscriptionId" value="<%=daForm.getDabbaSubscriptionId() %>">
					  <input type="hidden" name="dabbas[<%=daI %>].id" id="dabbas[<%=daI %>].id" value="<%=daForm.getId() %>" />
					  <input type="hidden" name="dabbas[<%=daI %>].%>].idType" id="dabbas[<%=daI %>].idType" value="<%=daForm.getIdType() %>" />
					  <input type="hidden" name="dabbas[<%=daI %>].address.addressId" id="dabbas[<%=daI %>].address.addressId" value="<%=daForm.getAddress().getAddressId() %>" />
					  <input type="hidden" name="dabbas[<%=daI %>].address.addressType" id="dabbas[<%=daI %>].address.addressType" value="<%=daForm.getAddress().getAddressType() %>" />
					  <input type="hidden" name="dabbas[<%=daI %>].address.country" id="dabbas[<%=daI %>].address.country" value="<%=daForm.getAddress().getCountry() %>" />
					  <input type="hidden" name="dabbas[<%=daI %>].address.stateOrRegion" id="dabbas[<%=daI %>].address.stateOrRegion" value="<%=daForm.getAddress().getStateOrRegion() %>" />
	                	<table border="0" cellpadding="0" cellspacing="0" width="100%">
	                	  <tr>
	          				<td style="background:transparent url('./pages/image_gif/tb_header_blank_strip.gif') repeat-x top left;"><a href="javascript:;" 
	    		 style="background:transparent url('./pages/image_gif/tb_header_blank.jpg') no-repeat top right;  color:#efefef; padding:3px 30px 3px 10px; float:left; font-size:14px;text-decoration:none;" onClick="toggleOnOff('togrow6<%=daI%>')"><%=(daForm.getDabbaSubscriptionId()!=null&&!"".equals(daForm.getDabbaSubscriptionId().trim())?daForm.getDabbaSubscriptionId():RESOURCE.getString("ADD")) %></a></td>

	    				  </tr>
	    				  <TR bgcolor="#EBEBEB" id="togrow6<%=daI%>" style="display:block">
	    				  	<td>
	    				  	  <table border="1" cellpadding="0" cellspacing="0" width="100%">
	    				  	    <tr> 
	    							<TD width="15%"><%=RESOURCE.getString("DABBA_KEY")%></TD> 
	    							<TD width="35%"> 
	    							  <INPUT name="dabbas[<%=daI %>].dabbaKey" type="text" class="textBoxDashed mnd" id="dabbas[<%=daI %>].dabbaKey" value="<%=daForm.getDabbaKey() %>"  size="33" maxlength="20"> 
	    							</TD> 
	    							<TD width="15%"><%=RESOURCE.getString("SANKALP_RASHI")%></TD> 
	    							<TD width="35%"> 
	    							  <INPUT name="dabbas[<%=daI %>].sankalpRashi" type="text" class="textBoxDashed" id="dabbas[<%=daI %>].sankalpRashi" value="<%=daForm.getSankalpRashi() %>"  size="33" maxlength="10"> 
	    							</TD> 
    							  </tr>
    							  <tr> 
	    							<TD> 
	    						  		<%=RESOURCE.getString("ADDRESS")%>
	    						  	</td>
	    						  	<td>
	    							  <SELECT class="mnd" name="daAddress<%=daI %>" id="daAddress<%=daI %>" onchange="changeDabbaAddress('daAddress<%=daI %>',<%=daI %>);">
	    							  	<OPTION value="">Select</OPTION>
	    							  	<%
	    							  		addr = memberForm.getOfficeAddress();
	    							  	%>
	    							  	<option <%=(addr.getAddressType().equals(daForm.getAddress().getAddressType())?"selected":"")%> value="<%= addr.getAddressId()+"~"+addr.getAddressType()+"~"+addr.getCountry()+"~"+addr.getStateOrRegion()+"~"+addr.getDistrictOrCounty() %>">
	    							  		<%= addr.getAddressType()+" : "+addr.getCountry()+", "+addr.getStateOrRegion()+", "+addr.getDistrictOrCounty() %>
	    							  	</option>

	    							  	<%
	    							  		addr = memberForm.getPermanentAddress();
	    							  	%>
	    							  	<option <%=(addr.getAddressType().equals(daForm.getAddress().getAddressType())?"selected":"")%> value="<%= addr.getAddressId()+"~"+addr.getAddressType()+"~"+addr.getCountry()+"~"+addr.getStateOrRegion()+"~"+addr.getDistrictOrCounty() %>">
	    							  		<%= addr.getAddressType()+" : "+addr.getCountry()+", "+addr.getStateOrRegion()+", "+addr.getDistrictOrCounty() %>
	    							  	</option>

	    							  	<%
	    							  		addr = memberForm.getPresentAddress();
	    							  	%>
	    							  	<option <%=(addr.getAddressType().equals(daForm.getAddress().getAddressType())?"selected":"")%> value="<%= addr.getAddressId()+"~"+addr.getAddressType()+"~"+addr.getCountry()+"~"+addr.getStateOrRegion()+"~"+addr.getDistrictOrCounty() %>">
	    							  		<%= addr.getAddressType()+" : "+addr.getCountry()+", "+addr.getStateOrRegion()+", "+addr.getDistrictOrCounty() %>
	    							  	</option>

	    							  </SELECT>
	    							  </TD>
	    							  <td></td>
	    							  <td></td> 
	    						  </TR> 
	    						  <TR bgcolor="#EBEBEB"> 
	    							<TD><%=RESOURCE.getString("START_DATE")%></TD> 
	    							<TD> 
	    							  <INPUT name="dabbas[<%=daI %>].startDate" type="text" class="textBoxDashed mnd" value="<%=daForm.getStartDate() %>" id="dabbas[<%=daI %>].startDate" size="33" maxlength="10"> 
	    							  <script>
	    							    new JsDatePick({
	    							        useMode:2,
	    							        target:"dabbas[<%=mzI %>].startDate",
	    							        dateFormat:"%m/%d/%Y",
	    							        isStripped:false,
	    							        selectedDate:null,
	    							        yearsRange: new Array(TODAY.getFullYear()-15,TODAY.getFullYear()),
	    							        limitToToday:true,
	    							        cellColorScheme:'ocean_blue'
	    							    });
	    							  </script> 
	    							</TD>
	    							<TD><%=RESOURCE.getString("END_DATE")%></TD> 
	    							<TD>
	    							  <INPUT name="dabbas[<%=daI %>].endDate" type="text" class="textBoxDashed" value="<%=daForm.getEndDate() %>" id="dabbas[<%=daI %>].endDate" size="33" maxlength="10"> 
	    							  <script>
	    							    new JsDatePick({
	    							        useMode:2,
	    							        target:"dabbas[<%=mzI %>].endDate",
	    							        dateFormat:"%m/%d/%Y",
	    							        isStripped:false,
	    							        selectedDate:null,
	    							        yearsRange: new Array(TODAY.getFullYear()-15,TODAY.getFullYear()+100),
	    							        limitToToday:true,
	    							        cellColorScheme:'ocean_blue'
	    							    });
	    							  </script> 
	    							</TD>
	    						  </TR>
	    						  <TR bgcolor="#EBEBEB"> 
	    						  </TR>
	    						  <TR bgcolor="#EBEBEB"> 
	    							  <TD><%=RESOURCE.getString("REF_VY_ID")%></TD> 
	    							  <TD> 
	    							  	<INPUT name="dabbas[<%=daI %>].refVyId" type="text" class="textBoxDashed" id="dabbas[<%=daI %>].refVyId" value="<%=daForm.getRefVyId() %>" size="33" maxlength="50"> 
	    							  </TD> 
	    							  <TD><%=RESOURCE.getString("DELETE")%></TD> 
	    							  <TD> 
	    							  	<input type="radio" name="dabbas[<%=daI %>].isActive" id="dabbas[<%=daI %>].isActive1" <%=("true".equalsIgnoreCase(daForm.getIsActive())?"checked" : "")%> value="false" /><%=RESOURCE.getString("YES") %>
	    							  	<input type="radio" name="dabbas[<%=daI %>].isActive" id="dabbas[<%=daI %>].isActive2" <%=("true".equalsIgnoreCase(daForm.getIsActive())?"checked" : "")%> value="true" /><%=RESOURCE.getString("NO") %>
	    							  </TD> 
	    						  </TR>
	    						</table>
	    					  </td> 
	    				  </TR> 
	    				</table>
	    			  </div>
	            	<%	
	            	}
				}
            %>
            	<div style="padding:5px 30px 15px 30px">
            		<input type="button" onclick="addDabba()" value="<%=RESOURCE.getString("ADD_DABBA_SUBSCRIPTION") %>" />
            	</div>
			</td>
		  </tr>
		  <TR> 
      		<td><a href="javascript:;" onclick="toggleOnOff('togrow4')"><img src="./pages/image_gif/comt.gif" alt="" name="comments" border="0" width="100%" height="22"></a></td>
		  </TR>
		  <TR bgcolor="#EBEBEB" id="togrow4" style="display:block">
           	<TD colspan="4">
				<div>
		  			<%=memberForm.getComments() %>
		  		</div>
		  		<br />
           		<textarea name="comments" id="comments" cols="50" rows="4" tabindex="90"></textarea></TD>
	      </TR> 
		  <TR bgcolor="#F0E7DD"> 
            <TD>&nbsp;</TD> 
          </TR> 
          <TR bgcolor="#EBEBEB"> 
            <TD>
              <DIV style="text-align:right;">&nbsp; 
                <INPUT type="reset" name="clear" value="<%=RESOURCE.getString("CLEAR") %>"> 
                &nbsp;&nbsp;<INPUT name="save" type="submit" value="<%=RESOURCE.getString("SAVE") %>" >
                &nbsp;&nbsp;<a name="cancel" href="./mntnmember.do"><%=RESOURCE.getString("CANCEL") %></a>&nbsp;&nbsp;
              </DIV>
            </TD> 
          </TR> 
		</TABLE>
		<%
			JSON obj = JSONSerializer.toJSON(memberForm.getPatrikas());
		%> 
		<INPUT type="hidden" name="patrikaMap" id="patrikaMap" value='<%=obj.toString() %>'>
 <br/>
 <br/>
 <br/>
 <br/>
</form>
<script>

	function addPatrika(){
		var ofa=document.getElementById("officeAddress.country"),
			pea=document.getElementById("presentAddress.country"),
			pma=document.getElementById("permanentAddress.country");
		if(ofa.value == "" && pea.value == "" && pma.value == "" ){
			alert("Kindly add atleast one address first");
			return;
		}
		var mode=document.getElementById("mode");
		if(mode) mode.value="<%=ModuleEnum.ADD_SUBSCRIPTION.getName() %>";
		document.forms[FORM].action = "<%=(memberForm.getVyId()!=null&&!"".equals(memberForm.getVyId().trim())? ModuleEnum.EDIT_MEMBER.getUrl() : ModuleEnum.ADD_MEMBER.getUrl()) %>";
		document.forms[FORM].submit();
	}

	function addDabba(){
		var ofa=document.getElementById("officeAddress.country"),
			pea=document.getElementById("presentAddress.country"),
			pma=document.getElementById("permanentAddress.country");
		if(ofa.value == "" && pea.value == "" && pma.value == "" ){
			alert("Kindly add atleast one address first");
			return;
		}
		var mode=document.getElementById("mode");
		if(mode) mode.value="<%=ModuleEnum.ADD_PATRA.getName()%>";
		document.forms[FORM].action = "<%=(memberForm.getVyId()!=null&&!"".equals(memberForm.getVyId().trim())? ModuleEnum.EDIT_MEMBER.getUrl() : ModuleEnum.ADD_MEMBER.getUrl()) %>";
		document.forms[FORM].submit();
	}

	function changePatrika(id, idx){
		var sel = document.getElementById(id);
		var val = sel.value;
		if(val != ""){
			var arr = val.split("~");
			document.getElementById("magazines["+ idx +"].patrikaId").value=arr[0];
			document.getElementById("magazines["+ idx +"].patrikaName").value=arr[3];
			document.getElementById("magazines["+ idx +"].patrikaCost").value=arr[1];
			document.getElementById("magazines["+ idx +"].weekOffsetIndex").value=arr[2];

			changePatrikaPeriod(idx);
			//var cost = document.getElementById("magazines["+ idx +"].patrikaCost").value,
			//qty=document.getElementById("magazines["+ idx +"].quantity").value;
		
			//if(cost !="" && qty != ""){
			//	cost=parseInt(cost,10);
			//	qty=parseInt(qty,10);
			//	document.getElementById("magazines["+ idx +"].totalAmount").value=cost*qty;
			//}
		}
	}

	function changePatrikaPeriod(idx){
		var sel = document.getElementById("mzPatrika"+idx);
		var val = sel.value;
		if(val != ""){
			var arr = val.split("~");		
			var patrikas = eval("("+document.getElementById("patrikaMap").value+")"),
			td = document.getElementById("mzAddress"+ idx +"_td");
			document.getElementById("magazines["+ idx +"].endDate").value="";
			
			td.innerHTML = "";
			var periods = patrikas[arr[0]], str="", periodFound=false,
				cc = document.getElementById("magazines["+ idx +"].address.country").value;
			for(var i=0; i< periods.length; i++){
				if(periods[i].countryCode == cc ){
					periodFound = true;
					str += "<input type='radio' id='magazines"+ idx +"Period' name='magazines"+ idx +"Period' value='"+ periods[i].periodMonth +"' onclick='selectPeriod("+ idx +");'>&nbsp;"+periods[i].periodName+"&nbsp;&nbsp;";
				}
			}
			if(!periodFound){
				for(var i=0; i< periods.length; i++){
					if(periods[i].countryCode == "-1"){
						str += "<input type='radio' id='magazines"+ idx +"Period' name='magazines"+ idx +"Period' value='"+ periods[i].periodMonth +"' onclick='selectPeriod("+ idx +");'>&nbsp;"+periods[i].periodName+"&nbsp;&nbsp;";
					}
				}
			}
			if(str != "")
				td.innerHTML = str;
		}
	}

	function selectPeriod(idx){
		var stDt = document.getElementById("magazines["+ idx +"].startDate").value;
		var enDt = document.getElementById("magazines["+ idx +"].endDate");
		var val=11,rdo = document.getElementsByName("magazines"+ idx +"Period");
		
		if(rdo.length > 1){
			for(var j=0; j< rdo.length; j++){
				if(rdo[j].checked) val = rdo[j].value;
			}
		}else{
			rdo = document.getElementById("magazines"+ idx +"Period");
			if(rdo.checked) val = rdo.value;
		}
		if(stDt == "") return;
		var dt = stDt.split("/"), mn=parseInt(dt[1],10),yr=parseInt(dt[2],10);
		for(var m=val; m>1; m--){
			if(mn==12){
				mn=1;
				yr++;
			}else{
				mn++;
			}
		}
		mn = ((mn<10)? "0"+mn : mn);
		enDt.value = "01"+ "/"+ mn +"/" + yr;
	}

	function changeAddress(id, idx){
		var sel = document.getElementById(id);
		var val = sel.value;
		if(val != ""){
			var arr = val.split("~");
			document.getElementById("magazines["+ idx +"].address.addressId").value=arr[0];
			document.getElementById("magazines["+ idx +"].address.addressType").value=arr[1];
			document.getElementById("magazines["+ idx +"].address.country").value=arr[2];
			document.getElementById("magazines["+ idx +"].address.stateOrRegion").value=arr[3];

			changePatrikaPeriod(idx);
		}
	}

	function changeDabbaAddress(id, idx){
		var sel = document.getElementById(id);
		var val = sel.value;
		if(val != ""){
			var arr = val.split("~");
			document.getElementById("dabbas["+ idx +"].address.addressId").value=arr[0];
			document.getElementById("dabbas["+ idx +"].address.addressType").value=arr[1];
			document.getElementById("dabbas["+ idx +"].address.country").value=arr[2];
			document.getElementById("dabbas["+ idx +"].address.stateOrRegion").value=arr[3];
		}
	}

	function changePrintLanguage(pfx){
		if(document.getElementById(pfx+".printLanguage").value != "en"){
			document.getElementById(pfx+".lang").style.display = "";
			document.getElementById(pfx+".coName").className = "kd010";
		}else{
			document.getElementById(pfx+".lang").style.display = "none";
			document.getElementById(pfx+".coName").className = "";
		}
	}

	function changeQuantity(id, idx){
		var sel = document.getElementById(id);
		var val = sel.value;
		if(val != ""){
			var cost = document.getElementById("magazines["+ idx +"].patrikaCost").value,
				qty=document.getElementById("magazines["+ idx +"].quantity").value;
			
			if(cost !="" && qty != ""){
				cost=parseInt(cost,10);
				qty=parseInt(qty,10);
				document.getElementById("magazines["+ idx +"].totalAmount").value=cost*qty;
			}
		}
	}

	//attachLangSupport("<%=ActionCtx.ctx().getLang()%>","memberForm");
	
	var metaSvc = new MetaService(), metaSvc1 = new MetaService(), metaSvc2 = new MetaService()
	, metaSvc3 = new MetaService();
	metaSvc.getMeta("RELIGION_SERVICE", "RELIGION=<%=memberForm.getReligion()%>", {"religion": "religion"});
	metaSvc1.getMeta("PROFESSION_SERVICE", "PROFESSION=<%=memberForm.getProfession()%>", {"profession": "profession"});
	metaSvc2.getMeta("QUALIFICATION_SERVICE", "QUALIFICATION=<%=memberForm.getQualification()%>", {"qualification": "qualification"});
//	metaSvc3.getMeta("COUNTRY_META_SERVICE", "COUNTRY=<%=memberForm.getNationality()%>", {"country": "nationality", "district": "districtOrCounty", "state":"stateOrRegion", "city":"city"});

	function getMetadata(req) {
		metaSvc3.getMeta("COUNTRY_META_SERVICE", req, {"country": "nationality,presentAddress.country,officeAddress.country,permanentAddress.country", 
						"district": "presentAddress.districtOrCounty,officeAddress.districtOrCounty,permanentAddress.districtOrCounty", 
						"state":"presentAddress.stateOrRegion,officeAddress.stateOrRegion,permanentAddress.stateOrRegion",
						"city":"presentAddress.city,officeAddress.city,permanentAddress.city"});
	}
	function getAddressMetadata(req, idpx) {
		metaSvc3.getMeta("COUNTRY_META_SERVICE", req, {"country" : idpx+"country", 
						"district" : idpx+"districtOrCounty", 
						"state" : idpx+"stateOrRegion",
						"city" : idpx+"city"});
	}
	function countryChange(idpx){
		if(idpx){
			getAddressMetadata("QUERY=STATE&COUNTRY="+document.getElementById(idpx+"country").value, idpx);
		}else{
			getMetadata("QUERY=COUNTRY&COUNTRY="+"<%=memberForm.getNationality()
							+","+memberForm.getPresentAddress().getCountry() 
							+","+memberForm.getOfficeAddress().getCountry()
							+","+ memberForm.getPermanentAddress().getCountry()%>");
		}
	}
	function countryState(idpx){
		if(idpx){
			getAddressMetadata("QUERY=CITY&COUNTRY="+document.getElementById(idpx+"country").value+
					"&STATE="+document.getElementById(idpx+"stateOrRegion").value, idpx);
		}
	}

	addEvent('presentAddress.country', 'change', function(){ countryChange("presentAddress."); });
	addEvent('officeAddress.country', 'change', function(){ countryChange("officeAddress."); });
	addEvent('permanentAddress.country', 'change', function(){ countryChange("permanentAddress."); });
	addEvent('presentAddress.stateOrRegion', 'change', function(){ countryState("presentAddress."); });
	addEvent('officeAddress.stateOrRegion', 'change', function(){ countryState("officeAddress."); });
	addEvent('permanentAddress.stateOrRegion', 'change', function(){ countryState("permanentAddress."); });

//	attachLangSupport(['regionalLangName','presentAddress.streetHindi1','presentAddress.streetHindi2'
//	                   ,'officeAddress.streetHindi1','officeAddress.streetHindi2'
//	                   ,'permanentAddress.streetHindi1','permanentAddress.streetHindi2']);
	FORM="memberForm";
</script>

</body>
</html>